package com.example.demo.controller;

import com.example.demo.common.R;
import com.example.demo.pojo.vo.LoginReVo;
import com.example.demo.pojo.vo.LoginVo;
import com.example.demo.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @Author mhx
 * @date 2022-11-17-3:44 下午
 */
@RestController
@Slf4j
@RequestMapping("/user")
public class UserController {

    @Resource
    private IUserService iUserService;
    @PostMapping("login")
    private R<LoginReVo> login(@Valid  @RequestBody LoginVo loginVo){
       R<LoginReVo> r = iUserService.login(loginVo);
       return r;
    }
}
